﻿using System;
using System.Text.RegularExpressions;
using WAD.DAL;
using WAD.WEB.AppCode;
using System.Collections.Generic;
namespace WAD.WEB.Client2.Page
{
    public partial class QQ : WebBase
    {
        protected string vid;
        protected object html;
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Parse.Int("source_id", 0);
            if (id > 0)
            {
                Dictionary<string, object> dic = Get(id);
                html = dic["source"];
                
                vid = Convert.ToString(dic["url"]);
                
                if (vid.IndexOf("vid=") > -1)
                    vid = vid.Substring(vid.IndexOf("vid=") + 4);

                if (vid.IndexOf("&") > -1)
                    vid = vid.Substring(0, vid.IndexOf("&"));

                //vid没获取到，则从链接里取
                if (vid.IndexOf("v.qq.com") > -1)
                {
                    if (vid.LastIndexOf("/") > -1)
                    {
                        vid = vid.Substring(vid.LastIndexOf("/") + 1);
                        if (vid.IndexOf(".") > -1)
                            vid = vid.Substring(0, vid.IndexOf("."));
                    }
                }
                
                //Response.Write(url);
                //Response.End();
            }
        }
    }
}